package com.atguigu.springcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class PaymentController {

    private static final String SERVICE_URL = "cloud-provider-payment-consul8006";
    @Autowired
    RestTemplate restTemplate;

    @GetMapping(value = "/get/payment/consul")
    public String get() {
        return restTemplate.getForObject("http://" + SERVICE_URL + "/get/payment/consul", String.class);
    }
}
